<%@ page contentType="text/html; charset=utf-8" language="java"  errorPage="" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<%=basePath%>"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>快捷菜单</title>
<jsp:include page="/admin/common/css/style_sub.jsp"></jsp:include>
<script type="text/javascript" src="<%=basePath%>js/lib/jquery/jquery-1.7.min.js"></script>
<script language="javascript" type="text/javascript" src="<%=basePath%>js/public.js"></script>
<script type="text/javascript">
function check(ck){
	var count;
	var content="";
	$checkList = $(":checkbox[checked='checked']");
	count=$checkList.size();
	if(count>6){
		alert("最多可以选择六个");
		ck.checked=false;
		bianbai();
	}
}
function back(){
	bianhui();
	var count;
	var content="";
	$checkList = $(":checkbox[checked='checked']");
	count=$checkList.size();
	if(count>6){
		alert("最多可以选择六个");
		bianbai();
	}else{
		$checkList.each(function(){
			content+=this.value+";";
		});
		if(content==''){
			content='0';
		}
		$.ajax({
  			type: "post",
  			url: "ShortPart_chooseShortPart.action?ids="+content+"&",
  			dataType: "text",
  			success:function(){
  				
  			}
		});
		window.returnValue = "refresh";
		window.close();
	}
}
function choseall(id){
	var cblist = document.getElementsByName('checkbox'+id);
	var flag;
	for(var j=0;j<cblist.length;j++){
		if(cblist[j].checked==''){
			flag = true;
			break;
		}else{
			flag = false;
		}
	}
	
	for(var k=0;k<cblist.length;k++){
		if(flag){
			cblist[k].checked='checked';
		}else{
			cblist[k].checked='';
		}	
	}
}
function shouqi(tid){
  var yesno = document.getElementById(tid);
  var tup = document.getElementById(tid+"1");
  if(yesno.style.display == 'none'){
  	yesno.style.display = 'block';
	tup.src = "style/images/ico_expand.jpg";
  }else{
  	yesno.style.display = 'none';
	tup.src = "style/images/ico_collapse.jpg";
  }
}
</script>
<link href="css/styles.css" rel="stylesheet" type="text/css" />
</head>
<body style="overflow:hidden;">
<form action="<%=basePath %>basic/sys/sysmain_insertFastMenu.action" id="form" method="post">
<div style="height:460px; width:900px; overflow:auto;"  >
<table width="780" border="0" cellspacing="0" cellpadding="5" class="msgShow">
 <s:iterator value="showMap" id="map">
 <s:if test="#map.value.size>0">
	    <tr>
			<td colspan="6" class="TableTdStyle3"><a href="javascript:shouqi('<s:property value="#map.key.id"/>');">
			<img id='<s:property value="#map.key.id"/>1' src="images/ico_24.jpg" height="9" width="9" border="0" /><s:property value="#map.key.name"/></a></td>
		</tr>
		<tbody id='<s:property value="#map.key.id"/>'>
		<s:iterator value="#map.value" id="obj" status="st">
	        	<s:if test="#st.index<#map.value.size()/3">
			<tr onmouseover ="this.style.backgroundColor='#ECF8FF'" onmouseout= "this.style.backgroundColor='#fff'">
	        	<td class="TableTdStyleLeft2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	        	<input type="checkbox" name="userfastList.right_id" onclick="check(this);" value="<s:property value="#map.value[#st.index*3].id"/>" <s:if test="#map.value[#st.index*3].chose==1">checked</s:if> /><s:property value="#map.value[#st.index*3].name"/></td>
	        	<td class="TableTdStyleLeft2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	        	<input type="checkbox" name="userfastList.right_id" onclick="check(this);" value="<s:property value="#map.value[#st.index*3+1].id"/>" <s:if test="#map.value[#st.index*3+1].chose==1">checked</s:if> /><s:property value="#map.value[#st.index*3+1].name"/></td>
	        	<td class="TableTdStyleLeft2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	        	<input type="checkbox" name="userfastList.right_id" onclick="check(this);" value="<s:property value="#map.value[#st.index*3+2].id"/>" <s:if test="#map.value[#st.index*3+2].chose==1">checked</s:if> /><s:property value="#map.value[#st.index*3+2].name"/></td>
	    	</tr>
	        	</s:if>
	    </s:iterator>
	     <s:if test="#map.value.size()%3==1">
	    <tr onmouseover ="this.style.backgroundColor='#ECF8FF'" onmouseout= "this.style.backgroundColor='#fff'">
	    		<td class="TableTdStyleLeft2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	        	<input type="checkbox" name="userfastList.right_id" onclick="check(this);" value="<s:property value="#map.value[#map.value.size()-1].id"/>" <s:if test="#map.value[#map.value.size()-1].chose==1">checked</s:if> /><s:property value="#map.value[#map.value.size()-1].name"/></td>
	    		<td class="TableTdStyleLeft2">&nbsp;</td>
	    		<td class="TableTdStyleLeft2">&nbsp;</td>
	    </tr>
	    </s:if>
	    	<s:elseif test="#map.value.size()%3==2">
	    	<tr onmouseover ="this.style.backgroundColor='#ECF8FF'" onmouseout= "this.style.backgroundColor='#fff'">
	    		<td class="TableTdStyleLeft2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	        	<input type="checkbox" name="userfastList.right_id" onclick="check(this);" value="<s:property value="#map.value[#map.value.size()-2].id"/>" <s:if test="#map.value[#map.value.size()-2].chose==1">checked</s:if> /><s:property value="#map.value[#map.value.size()-2].name"/></td>
	    		<td class="TableTdStyleLeft2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	        	<input type="checkbox" name="userfastList.right_id" onclick="check(this);" value="<s:property value="#map.value[#map.value.size()-1].id"/>" <s:if test="#map.value[#map.value.size()-1].chose==1">checked</s:if> /><s:property value="#map.value[#map.value.size()-1].name"/></td>
	    		<td class="TableTdStyleLeft2">&nbsp;</td>
	    	</tr>
	    	</s:elseif>
	    </tbody>
	    </s:if>
 </s:iterator>
 <s:if test="showMap==null">
	 <tr onmouseover ="this.style.backgroundColor='#ECF8FF'" onmouseout= "this.style.backgroundColor='#fff'">
	        <td class="TableTdStyle1" style="color:red;">您没有被授权使用任何菜单</td>
	    </tr>
 </s:if>
</table> 
</div>
    <div style="text-align:center;"><span class="btn"><input type="submit" name="button" id="button" value="确定" /></span>
    <span class="btn"><input type="reset" name="button" id="button" value="重置" class="btnStyle78PX"/></span>
    </div>
</form>
</body>
</html>